import request from '@/utils/request'
//试卷列表
export function fetchExamList(data) {
  return request({
    url: '/api/v1//ask/getAll',
    method: 'post',
    data: data
  })
}
//试卷详情
export function getExamDetail(id) {
  return request({
    url: '/api/v1/ask/detail/'+id,
    method: 'post'
  })
}
//试卷对应的问题列表
export function getQuestionsByExam(examId) {
    return request({
        url: '/api/v1/ask/questions/'+examId,
        method: 'post'
    })
}
//创建考试记录
export function createExamRecord(data) {
    console.info("创建考试记录")
    return request({
        url: '/api/v1/ask/record/create',
        method: 'post',
        data: data
    })
}
//提交答案
export function submitAnswers(data) {
  console.info("提交考试")
  return request({
      url: '/api/v1/ask/record/submit',
      method: 'post',
      data: data
  })
}
//获取考试记录详情
export function getExamRecordDetail(recordId) {
  return request({
    url: '/api/v1/ask/record/detail/'+recordId,
    method: 'post'
})
}

